//
//  YSMBaseTableViewController.m
//  YSMWeibo
//
//  Created by 杨思明 on 16/7/24.
//  Copyright © 2016年 杨思明. All rights reserved.
//

#import "YSMBaseTableViewController.h"
#import "YSMVisitorView.h"
#import "YSMHomeTableViewController.h"
#import "YSMDiscoverTableViewController.h"
#import "YSMMessageTableViewController.h"
#import "YSMProflieTableViewController.h"
@interface YSMBaseTableViewController ()

@property(nonatomic,assign)BOOL userLogin;
@property(nonatomic,strong)YSMVisitorView *V;

@end

@implementation YSMBaseTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
}
-(void)loadView{
    self.userLogin = NO;

    if (self.userLogin) {
        [super loadView];
    }else{
        
        YSMVisitorView *V = [YSMVisitorView addView];
        self.V = V;
        self.view = V;
        V.backgroundColor =  [UIColor colorWithWhite:237/255.0 alpha:1.0];
        
        self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"注册" style:UIBarButtonItemStylePlain target:self action:@selector(wocao)];
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc]initWithTitle:@"登录" style:UIBarButtonItemStylePlain target:self action:@selector(nima)];
        
        
        
        if ([self isKindOfClass:[YSMHomeTableViewController class]]) {
            
            
        }else if ([self isKindOfClass:[YSMMessageTableViewController class]]){
            [V imageName:@"visitordiscover_image_message" text:@"登录后，别人评论你的微博，发给你的消息，都会在这里收到通知"];
            
        }else if ([self isKindOfClass:[YSMDiscoverTableViewController class]]){
            [V imageName:@"visitordiscover_image_message" text:@"登录后，最新、最热微博尽在掌握，不再会与实事潮流擦肩而过"];
            
        }else if ([self isKindOfClass:[YSMProflieTableViewController class]]){
            
            [V imageName:@"visitordiscover_image_profile" text:@"登录后，你的微博、相册、个人资料会显示在这里，展示给别人"];
        }
    }
}
-(void)wocao{
    [self.V wocao];

}

-(void)nima{
    [self.V nima];

}
@end
